package com.example.easyexcellearn.bean;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;

import java.util.Date;

/**
 * 阿里 easyExcel 相关注解
 * https://www.yuque.com/easyexcel/doc/write
 */
@Data
@ColumnWidth(25)
public class DemoData {

    /**
     *      @ExcelProperty 指定要导出的列
     *      value指定该列的标题
     *      index指定该列在excel的显示位置,0指第一列
     */
    @ExcelProperty(value = "字符串标题",index = 0)
    private String string;

    /**
     * 宽度为50
     */
    @ColumnWidth(50)
    @ExcelProperty(value = "日期标题",index = 1)
    @DateTimeFormat("yyyy年MM月dd日HH时mm分ss秒")
    private Date date;

    @ExcelProperty(value = "数字标题",index = 2)
    private Double doubleData;

    /**
     *    @ExcelIgnore 忽略这个字段
     */
    @ExcelIgnore
    private String ignore;

}